﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kokomo.Environment.Commanding;
using System.Windows.Input;

namespace Kokomo.Environment.Hosting
{
	class NewDocumentMenuItemViewModel : MenuItemViewModel
	{
		public DocumentTemplate Template { get; private set; }
		public ICommand CreateDocumentCommand { get; private set; }

		public NewDocumentMenuItemViewModel(
			DocumentTemplate template,
			ICommand createDocumentCommand
			)
		{
			if (template == null) throw new ArgumentNullException("template");
			if (createDocumentCommand == null) throw new ArgumentNullException("createDocumentCommand");

			this.Template = template;
			this.CreateDocumentCommand = createDocumentCommand;
		}

		public override UiString Text
		{
			get { return this.Template.Title; }
		}
		public override ICommand Command
		{
			get
			{
				return this.CreateDocumentCommand;
			}
		}
		public override object CommandArgument
		{
			get
			{
				return this.Template;
			}
		}
	}
}
